const menuTree =(menuList)=>{
    let returnList = []
    let dictionaryList = {}
    let data = menuList;

    data.forEach((item,index)=>{
        data[index].key = index
        dictionaryList[data[index].id] = data[index]
    })
    data.forEach((item)=>{
        let parent  = dictionaryList[item.parent_id]
        if(parent){
            parent['children']= [];
            parent['children'].push(item)
        }else{
            returnList.push(item);
        }
    })
    return returnList;
}
export default menuTree